package com.example.oneservice.controller;


import com.example.oneservice.common.ResponseDto;
import com.example.oneservice.domain.User;
import com.example.oneservice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LXG
 * @since 2021-05-25
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    /**
     * 新增
     * @param user
     */
    @PostMapping("/addUser")
    public ResponseDto addUser(@RequestBody User user) {
        userService.addUser(user);
        return new ResponseDto(0,"添加成功");
    }

}

